import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/task/base_danger_investigation_entity.dart';

BaseDangerInvestigationEntity $BaseDangerInvestigationEntityFromJson(Map<String, dynamic> json) {
  final BaseDangerInvestigationEntity baseDangerInvestigationEntity = BaseDangerInvestigationEntity();
  final String? dangerLevel = jsonConvert.convert<String>(json['dangerLevel']);
  if (dangerLevel != null) {
    baseDangerInvestigationEntity.dangerLevel = dangerLevel;
  }
  final String? dangerLevelDicId = jsonConvert.convert<String>(json['dangerLevelDicId']);
  if (dangerLevelDicId != null) {
    baseDangerInvestigationEntity.dangerLevelDicId = dangerLevelDicId;
  }
  final String? dangerManageDeadline = jsonConvert.convert<String>(json['dangerManageDeadline']);
  if (dangerManageDeadline != null) {
    baseDangerInvestigationEntity.dangerManageDeadline = dangerManageDeadline;
  }
  final String? dangerRecordDesc = jsonConvert.convert<String>(json['dangerRecordDesc']);
  if (dangerRecordDesc != null) {
    baseDangerInvestigationEntity.dangerRecordDesc = dangerRecordDesc;
  }
  final String? dangerState = jsonConvert.convert<String>(json['dangerState']);
  if (dangerState != null) {
    baseDangerInvestigationEntity.dangerState = dangerState;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    baseDangerInvestigationEntity.id = id;
  }
  final String? riskEventName = jsonConvert.convert<String>(json['riskEventName']);
  if (riskEventName != null) {
    baseDangerInvestigationEntity.riskEventName = riskEventName;
  }
  final String? riskMeasureDesc = jsonConvert.convert<String>(json['riskMeasureDesc']);
  if (riskMeasureDesc != null) {
    baseDangerInvestigationEntity.riskMeasureDesc = riskMeasureDesc;
  }
  final String? controlMeasures = jsonConvert.convert<String>(json['controlMeasures']);
  if (controlMeasures != null) {
    baseDangerInvestigationEntity.controlMeasures = controlMeasures;
  }
  final String? liableDate = jsonConvert.convert<String>(json['liableDate']);
  if (liableDate != null) {
    baseDangerInvestigationEntity.liableDate = liableDate;
  }
  final String? riskObjectName = jsonConvert.convert<String>(json['riskObjectName']);
  if (riskObjectName != null) {
    baseDangerInvestigationEntity.riskObjectName = riskObjectName;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    baseDangerInvestigationEntity.riskUnitName = riskUnitName;
  }
  final String? troubleshootContent = jsonConvert.convert<String>(json['troubleshootContent']);
  if (troubleshootContent != null) {
    baseDangerInvestigationEntity.troubleshootContent = troubleshootContent;
  }
  return baseDangerInvestigationEntity;
}

Map<String, dynamic> $BaseDangerInvestigationEntityToJson(BaseDangerInvestigationEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['dangerLevel'] = entity.dangerLevel;
  data['dangerLevelDicId'] = entity.dangerLevelDicId;
  data['dangerManageDeadline'] = entity.dangerManageDeadline;
  data['dangerRecordDesc'] = entity.dangerRecordDesc;
  data['dangerState'] = entity.dangerState;
  data['id'] = entity.id;
  data['riskEventName'] = entity.riskEventName;
  data['riskMeasureDesc'] = entity.riskMeasureDesc;
  data['controlMeasures'] = entity.controlMeasures;
  data['liableDate'] = entity.liableDate;
  data['riskObjectName'] = entity.riskObjectName;
  data['riskUnitName'] = entity.riskUnitName;
  data['troubleshootContent'] = entity.troubleshootContent;
  return data;
}

extension BaseDangerInvestigationEntityExtension on BaseDangerInvestigationEntity {
  BaseDangerInvestigationEntity copyWith({
    String? dangerLevel,
    String? dangerLevelDicId,
    String? dangerManageDeadline,
    String? dangerRecordDesc,
    String? dangerState,
    String? id,
    String? riskEventName,
    String? riskMeasureDesc,
    String? controlMeasures,
    String? liableDate,
    String? riskObjectName,
    String? riskUnitName,
    String? troubleshootContent,
  }) {
    return BaseDangerInvestigationEntity()
      ..dangerLevel = dangerLevel ?? this.dangerLevel
      ..dangerLevelDicId = dangerLevelDicId ?? this.dangerLevelDicId
      ..dangerManageDeadline = dangerManageDeadline ?? this.dangerManageDeadline
      ..dangerRecordDesc = dangerRecordDesc ?? this.dangerRecordDesc
      ..dangerState = dangerState ?? this.dangerState
      ..id = id ?? this.id
      ..riskEventName = riskEventName ?? this.riskEventName
      ..riskMeasureDesc = riskMeasureDesc ?? this.riskMeasureDesc
      ..controlMeasures = controlMeasures ?? this.controlMeasures
      ..liableDate = liableDate ?? this.liableDate
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..troubleshootContent = troubleshootContent ?? this.troubleshootContent;
  }
}
